package com.myspace.backend.controller.post;

import com.myspace.backend.service.post.PostDeleteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class PostDeleteController {

    @Autowired
    private PostDeleteService postDeleteService;

    @DeleteMapping("/myspace/post/delete/")
    public Map<String, String> postDelete(@RequestParam Map<String, String> map) {
        String postId = map.get("post_id");
        return postDeleteService.postDelete(postId);
    }
}
